/**
* @Title: <P>UserController.java</P>
* @Package <P>com.micro.boot.biz.web</P>
* @Description: <P>TODO该类...</P>
* @author renweiping
* @date 2018年9月18日 下午5:42:09
* @version 1.0
*/

package com.micro.boot.biz.user.web;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.micro.boot.base.web.BaseController;
import com.micro.boot.biz.user.service.UserService;

/**
 * @Description: 用户控制器
 * @param
 * @throws @author
 *             renweiping
 * @e_mail renweiping_1113@google.com
 * @date 2018年9月18日
 */

@Controller
public class UserController extends BaseController {

	private UserService userService;

	@Autowired
	public void setUserService(UserService userService) {
		this.userService = userService;
	}

	@GetMapping("/sayHello")
	@ResponseBody
	public String sayHello(String message) {
		return "message:" + message;
	}

	@GetMapping("/sayHi")
	@ResponseBody
	public ResponseEntity<Map<String, Object>> sayHi(String message) {

		Map<String, Object> map = new HashMap<String, Object>();
		map.put("message", message);
		ResponseEntity<Map<String, Object>> response = new ResponseEntity<Map<String, Object>>(map, HttpStatus.OK);

		return response;
	}

	@GetMapping("/sayYou")
	@ResponseBody
	public ResponseEntity<String> sayYou(String message, int status) {
		ResponseEntity<String> response = null;

		response = new ResponseEntity<String>(message, HttpStatus.valueOf(status));

		return response;
	}
	
	
	

}
